<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@attribute name="users" required="true" type="java.util.List" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<fmt:setLocale value="${language}"/>
<fmt:bundle basename="messages" prefix="userlist.">
    <div class="table-responsive">
        <table class="table table-striped">
            <thead>
            <tr>
                <th><fmt:message key="name"/></th>
                <th><fmt:message key="surname"/></th>
                <th><fmt:message key="email"/></th>
                <th><fmt:message key="birthdate"/></th>
                <th><fmt:message key="gender"/></th>
                <th></th>
                <th></th>
                <th></th>
            </tr>
            </thead>
            <tbody>
            <c:forEach items="${users}" var="user">
                <tr>
                    <td>${user.name}</td>
                    <td>${user.surname}</td>
                    <td>${user.email}</td>
                    <td>${user.birthdate}</td>
                    <td>${user.gender}</td>
                    <td>
                        <form action="/maa/do" method="post"><input type="hidden" name="action"
                                                                    value="user-update-page"/>
                            <input type="hidden" name="uuid" value=${user.uuid}/>
                            <input class="btn btn-default mybtn" type="submit" value="<fmt:message key="update"/>"/>
                        </form>
                    </td>
                    <td>
                        <form action="/maa/do" method="post"><input type="hidden" name="action" value="remove-user"/>
                            <input type="hidden" name="uuid" value=${user.uuid}/>
                            <input class="btn btn-default mybtn" type="submit" value="<fmt:message key="remove"/>"/>
                        </form>
                    </td>
                    <td>
                        <form action="/maa/do" method="post"><input type="hidden" name="action"
                                                                    value="mentor-creation-page"/>
                            <input type="hidden" name="uuid" value=${user.uuid}/>
                            <input class="btn btn-default mybtn" type="submit" value="<fmt:message key="makementor"/>"/>
                        </form>
                    </td>
                </tr>
            </c:forEach>
            </tbody>
        </table>
    </div>
</fmt:bundle>